#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<malloc.h>
int Method_1(int n)
{
	if (n <= 2)
		return 1;
	else
		return (Method_1(n - 1) + Method_1(n - 2));
}

int Method_2(int n)
{
	int num1 = 1;
	int num2 = 1;
	int tmp = 1;

	while (n > 2)
	{
		tmp = num1 + num2;
		num1 = num2;
		num2 = tmp;
		n--;
	}
	return tmp;
}

int main()
{
	int n = 0;
	while (scanf("%d", &n) != EOF)
	{
		printf("%d\n", Method_1(n));
		printf("%d\n", Method_2(n));
	}
	return 0;
}